/*
 * Created by JFormDesigner on Mon Apr 10 16:39:47 CST 2023
 */

package com.canteen.gui.dishessearchform;

import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;

/**
 * @author s303teacher
 */
public class DishesSearchForm extends JFrame {
    public DishesSearchForm() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        dishesIdLabel = new JLabel();
        dishesIdInput = new JTextField();
        dishesNameLabel = new JLabel();
        dishesNameInput = new JTextField();
        dishesTypeLabel = new JLabel();
        dishesTypeInput = new JComboBox<>();
        searchButton = new JButton();
        scrollPane1 = new JScrollPane();
        dishesDetailTable = new JTable();
        modifyBuuton = new JButton();
        deleteButton = new JButton();
        dishesInformationLabel = new JLabel();
        scrollPane2 = new JScrollPane();
        dishesDetailPane = new JEditorPane();
        dishesImageShow = new JLabel();

        //======== this ========
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("\u83dc\u54c1\u67e5\u8be2");
        setResizable(false);
        var contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- dishesIdLabel ----
        dishesIdLabel.setText("\u83dc\u54c1\u53f7\uff1a");
        contentPane.add(dishesIdLabel);
        dishesIdLabel.setBounds(35, 20, 55, 35);
        contentPane.add(dishesIdInput);
        dishesIdInput.setBounds(95, 20, 150, 30);

        //---- dishesNameLabel ----
        dishesNameLabel.setText("\u83dc\u54c1\u540d\uff1a");
        contentPane.add(dishesNameLabel);
        dishesNameLabel.setBounds(275, 20, 55, 35);
        contentPane.add(dishesNameInput);
        dishesNameInput.setBounds(335, 20, 150, 30);

        //---- dishesTypeLabel ----
        dishesTypeLabel.setText("\u83dc\u54c1\u7c7b\uff1a");
        contentPane.add(dishesTypeLabel);
        dishesTypeLabel.setBounds(35, 60, 55, 35);

        //---- dishesTypeInput ----
        dishesTypeInput.setModel(new DefaultComboBoxModel<>(new String[] {
            "\u4e3b\u83dc",
            "\u914d\u83dc1",
            "\u914d\u83dc2"
        }));
        contentPane.add(dishesTypeInput);
        dishesTypeInput.setBounds(95, 65, 150, dishesTypeInput.getPreferredSize().height);

        //---- searchButton ----
        searchButton.setText("\u83dc\u54c1\u67e5\u627e");
        contentPane.add(searchButton);
        searchButton.setBounds(380, 65, 100, searchButton.getPreferredSize().height);

        //======== scrollPane1 ========
        {

            //---- dishesDetailTable ----
            dishesDetailTable.setModel(new DefaultTableModel(
                new Object[][] {
                    {null, null, null},
                    {null, null, null},
                },
                new String[] {
                    "\u83dc\u54c1\u53f7", "\u83dc\u54c1\u540d", "\u83dc\u54c1\u7c7b"
                }
            ));
            scrollPane1.setViewportView(dishesDetailTable);
        }
        contentPane.add(scrollPane1);
        scrollPane1.setBounds(35, 120, 450, 155);

        //---- modifyBuuton ----
        modifyBuuton.setText("\u4fee\u6539");
        contentPane.add(modifyBuuton);
        modifyBuuton.setBounds(new Rectangle(new Point(320, 290), modifyBuuton.getPreferredSize()));

        //---- deleteButton ----
        deleteButton.setText("\u5220\u9664");
        contentPane.add(deleteButton);
        deleteButton.setBounds(395, 290, 58, 28);

        //---- dishesInformationLabel ----
        dishesInformationLabel.setText("\u83dc\u54c1\u8be6\u60c5\uff1a");
        contentPane.add(dishesInformationLabel);
        dishesInformationLabel.setBounds(35, 345, 85, 35);

        //======== scrollPane2 ========
        {
            scrollPane2.setViewportView(dishesDetailPane);
        }
        contentPane.add(scrollPane2);
        scrollPane2.setBounds(40, 380, 220, 105);

        //---- dishesImageShow ----
        dishesImageShow.setText("\u56fe\u7247");
        contentPane.add(dishesImageShow);
        dishesImageShow.setBounds(320, 380, 160, 100);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        setSize(525, 375);
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel dishesIdLabel;
    private JTextField dishesIdInput;
    private JLabel dishesNameLabel;
    private JTextField dishesNameInput;
    private JLabel dishesTypeLabel;
    private JComboBox<String> dishesTypeInput;
    private JButton searchButton;
    private JScrollPane scrollPane1;
    private JTable dishesDetailTable;
    private JButton modifyBuuton;
    private JButton deleteButton;
    private JLabel dishesInformationLabel;
    private JScrollPane scrollPane2;
    private JEditorPane dishesDetailPane;
    private JLabel dishesImageShow;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
